<!DOCTYPE html>
<html>
<head>
	<title>注册</title>
	<meta charset="utf-8">
	<script type="text/javascript">
	!function(a){function b(){var b=g.getBoundingClientRect().width;a.rem=(b/6.4>100?100:(b/6.4<50?50:b/6.4)),g.style.fontSize=a.rem+"px"}var g=a.document.documentElement,e;a.addEventListener("resize",function(){clearTimeout(e),e=setTimeout(b,300)},!1),a.addEventListener("pageshow",function(a){a.persisted&&(clearTimeout(e),e=setTimeout(b,300))},!1),b()}(window);
	</script>
	<link rel="stylesheet" type="text/css" href="./css/css_reset.css" />
	<link rel="stylesheet" type="text/css" href="css.css" />
	<style type="text/css">
		body{background-color: #f5f6f7;}
		.wrapper{width: 12.6rem; margin: 0 auto; }
		/*注册表单*/
		.register .register-arrow{width: 1150px;margin: 0 auto;padding-top: 40px;}
		.register-form{width: 50%;color: #e5e5e5;padding-top: 40px;padding-bottom: 100px;margin: 0 auto;font-family: '方正兰亭黑','微软雅黑','黑体',sans-serif;}
		.register-form .input,.register-form .button {width: 70%;height: 50px;margin:30px auto;display: block;text-align: center;}
		.register-form .input{background-color: #fff;line-height: 50px;border-radius: 5px;border: 1px solid #e1e1e1;padding-left: 15px;}
		.register-form  label{display: inline-block;width:63px;height: 14px;font-size: 20px;color: #595757;float: left; }
		.register-form  input{width: 70%;height: 50px;border: none;outline: none;font-size: 18px;}
		.register-form .button button{width: 100%;line-height: 50px;border-radius: 5px;font-size: 20px;color: #797b7e;background-color: #1f242b;box-shadow:-webkit-box-shadow:1px 1px 1px black; box-shadow:1px 1px 1px black;border: none;outline: none;}
		.register-form .check-code-div{width: 40%;display: inline-block;float: left;margin-left: 100px;}
		.register-form .check-code-div input{float: right;width: 70%;}
		.register-form .check-code-link{float: right;width: 20%;height: 50px;display: inline-block;text-align: center;background-color: #fff;position: relative;right: 100px;top: 30px;background-color: #595757;color: #fff;font-size: 20px;line-height: 50px;}
	</style>
</head>
<body>
	<div class="wrapper">
		<iframe src="./common/head.html" frameborder="0" width="1260px" height="80px" scrolling="no" name="frame1" ></iframe>
		<div class="register">
			<div class="register-form">
				<div class="input">
					<label for="username">用户名</label>
					<input id="username" type="input" placeholder="如.xiaoqiang"></div>
				<div class="input">
					<label for="password">密码</label>
					<input id="password" type="password" placeholder="密码至少在7位以上"></div>
				<div class="input">
					<label for="email">邮箱</label>
					<input id="email" type="input" placeholder="545921090@qq.com"></div>
				<div class="input">
					<label for="telephone_number">手机号</label>
					<input id="telephone_number" type="input" placeholder="15668288009"></div>
				<div class="button" id="submit_button">
					<button >注册</button>
				</div>
			</div>
		</div>
		<iframe src="./common/foot.html" frameborder="0" width="1260px" height="370px" scrolling="no" name="frame2" ></iframe>
		s
	</div>
	<script type="text/javascript" charset="utf-8" src="./js/jquery-1.11.3.min.js"></script>
	<script type="text/javascript" chaeset="utf-8">
	$(document).ready(function(){
		$("#submit_button").on("click",function(){
			var jsonData = {
				"username" : $("#username").val(),
				"password" : $("#password").val(),
				"email" :$("#email").val(),
				"phoneCall" :$("#telephone_number").val(),
			}
			$.ajax({
					type: "POST",
					url:"./handler/reg.php",
					data:jsonData,
					datatype:"json",
					success :function(msg){
						var obj = JSON.parse(msg);
						alert(obj.isRegSuccess);
						if(obj.isRegSuccess){
							alert("注册成功！请登录");
							location.href="./login.html";
						}
						else{
							alert("注册失败！重新注册");
							location.reload(true);
						}
					}
				})
		})
})
</script>
</body>
</html>